﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace GDPView.Migrations
{
    public partial class InitialCreate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "GDPData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GDPYear = table.Column<int>(type: "int", nullable: false),
                    Data = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GDPData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SampleData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ContactInformation = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SpecificInformation = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SampleData", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "GDPGrowthRateData",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GDPGrowthRateData", x => x.Id);
                    table.ForeignKey(
                        name: "FK_GDPGrowthRateData_GDPData_Id",
                        column: x => x.Id,
                        principalTable: "GDPData",
                        principalColumn: "Id");
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "GDPGrowthRateData");

            migrationBuilder.DropTable(
                name: "SampleData");

            migrationBuilder.DropTable(
                name: "GDPData");
        }
    }
}
